/* Check JER_Matrix::Invertible(). */
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include "reed_sol-2.h"
#include "jerasure-2.h"
#include "galois-2.h"

using namespace std;

int main( int argc, char** argv )
{
	JER_Matrix *jm;
	JER_Matrix *jm2;
	int i, j;
	int fsize;

	int m = atoi( argv[1] );
	int k = atoi( argv[2] );
	int w = atoi( argv[3] );

	fsize = 1 << w;
	srand48(m);
	jm = new JER_Matrix( k, k, w );
	for( i = 0; i < k; i++ )
		for( j = 0; j < k; j++ )
			jm->Elts[i][j] = lrand48() % fsize;
	if( jm->Invertible() )
		fprintf( stdout, "This matrix is invertible\n" );

	return 0;
}
